<?php

namespace Models;

class Cleni extends Base
{
	/**
	 * If user doesn't exist, create it. Otherwise update it.
	 * @return false on update, true on new user
	 */

        /*public function addClen($kdo,$kde,$co,$coid= null)
        {   $datum = new \DateTime();
           //Nette\Diagnostics\Debugger::dump($datum);
            return $this->db->query("
                    INSERT INTO logger (kdo, kde, co, coid, kdy) VALUES (%i, %s, %s, %i, %t)", $kdo, $kde, $co,$coid, $datum
                                    );

        }
        public function setClen($kdo,$kde,$co,$coid= null)
        {   $datum = new \DateTime();
           //Nette\Diagnostics\Debugger::dump($datum);
            return $this->db->query("
                    INSERT INTO logger (kdo, kde, co, coid, kdy) VALUES (%i, %s, %s, %i, %t)", $kdo, $kde, $co,$coid, $datum
                                    );

        }*/
        public function getCleni()
        {
            return $this->db->dataSource("
                SELECT *
                FROM pov_clenove
                -- LEFT JOIN pov_clenove cle ON(log.kdo=cle.id)
                ORDER BY id DESC
                                    ");

        }
}